package com.xbao.dao;

import com.xbao.model.CheckPeriod;
import com.xbao.model.CheckPeriodExample;
import java.util.List;

import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;
@Mapper
public interface CheckPeriodMapper {
    @SelectProvider(type=CheckPeriodSqlProvider.class, method="countByExample")
    int countByExample(CheckPeriodExample example);

    @DeleteProvider(type=CheckPeriodSqlProvider.class, method="deleteByExample")
    int deleteByExample(CheckPeriodExample example);

    @Delete({
        "delete from check_period",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
        "insert into check_period (id, sid, pid, ",
        "orgid, checktime, ",
        "cid, status)",
        "values (#{id,jdbcType=BIGINT}, #{sid,jdbcType=BIGINT}, #{pid,jdbcType=BIGINT}, ",
        "#{orgid,jdbcType=BIGINT}, #{checktime,jdbcType=BIGINT}, ",
        "#{cid,jdbcType=BIGINT}, #{status,jdbcType=INTEGER})"
    })
    int insert(CheckPeriod record);

    @InsertProvider(type=CheckPeriodSqlProvider.class, method="insertSelective")
    int insertSelective(CheckPeriod record);

    @SelectProvider(type=CheckPeriodSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="sid", property="sid", jdbcType=JdbcType.BIGINT),
        @Result(column="pid", property="pid", jdbcType=JdbcType.BIGINT),
        @Result(column="orgid", property="orgid", jdbcType=JdbcType.BIGINT),
        @Result(column="checktime", property="checktime", jdbcType=JdbcType.BIGINT),
        @Result(column="cid", property="cid", jdbcType=JdbcType.BIGINT),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER)
    })
    List<CheckPeriod> selectByExample(CheckPeriodExample example);

    @Select({
        "select",
        "id, sid, pid, orgid, checktime, cid, status",
        "from check_period",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="sid", property="sid", jdbcType=JdbcType.BIGINT),
        @Result(column="pid", property="pid", jdbcType=JdbcType.BIGINT),
        @Result(column="orgid", property="orgid", jdbcType=JdbcType.BIGINT),
        @Result(column="checktime", property="checktime", jdbcType=JdbcType.BIGINT),
        @Result(column="cid", property="cid", jdbcType=JdbcType.BIGINT),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER)
    })
    CheckPeriod selectByPrimaryKey(Long id);

    @UpdateProvider(type=CheckPeriodSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") CheckPeriod record, @Param("example") CheckPeriodExample example);

    @UpdateProvider(type=CheckPeriodSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") CheckPeriod record, @Param("example") CheckPeriodExample example);

    @UpdateProvider(type=CheckPeriodSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(CheckPeriod record);

    @Update({
        "update check_period",
        "set sid = #{sid,jdbcType=BIGINT},",
          "pid = #{pid,jdbcType=BIGINT},",
          "orgid = #{orgid,jdbcType=BIGINT},",
          "checktime = #{checktime,jdbcType=BIGINT},",
          "cid = #{cid,jdbcType=BIGINT},",
          "status = #{status,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(CheckPeriod record);
}